import { postRequest, postRequestList, postRequestData, postRequestJson } from '../utils/request'
export const getRoleList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/system/role/pageRole`, data)

export const addRole = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/system/role/saveRole`, data)

export const editRole = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/system/role/updateRole`, data)

export const delRoleById = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/system/role/deleteRole`, data)

export const detailRoleById = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/system/role/getRoleDetail`, data)

export const updateRoleStatus = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/system/role/updateStatus`, data)

export const getAllRouteTree = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/system/route/getRouteTree`, data)

export const getUserRouteTree = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/system/route/getUserRoute`, data)

export const getAllMenuTree = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/system/route/getUserMenu`, data)
